package com.sinosoft.perfect.system._.service;

import java.io.InputStream;
import java.security.NoSuchAlgorithmException;
import java.sql.SQLException;
import java.util.List;

import com.sinosoft.perfect.system._.po.TRoleSystem;
import com.sinosoft.perfect.system._.vo.LoginUser;

public interface ILoginService {

	/**
	 * 返回int值,0表示登陆用户名密码错误,1正确登陆,-1代表工作站ip错误
	 * @param tuserInfo
	 * @return
	 * @throws SQLException
	 */
	public int validate(String username , String password,String loginIpAddress) throws NoSuchAlgorithmException,SQLException ;
	
	public LoginUser queryUserInfoAndLog(String username,String loginIpAddress) throws SQLException ;
	
	public List<TRoleSystem> queryUserRoleSystemsInfo(String userId) throws SQLException ;
	
	public void logoutUpdateLogInfo(String logId) throws SQLException ;
	
	public void registerLoginStatus(String loginId) throws SQLException ;
	
	public InputStream generateLoginImg(String userMainId) throws SQLException;
}
